-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open enumerations #1137
Open enumerations #1137
Conversation
Still going to add docs and changelog and such, just working on getting CI happy in the meantime |
One thing I still need to handle are collisions on the name |
That's interesting and well-timed as well, I was just thinking of how I'd support open enums in smithy-playground :) will try to review after the weekend as I'm OOO |
I'm happy for you to roll with this 👍 |
Ultimately decided to render all unknown enum members with a leading |
So apparently using the final case class $Unknown() So I changed it to be: final case class $$Unknown() which works fine, but it is obviously kind of ugly.. so open to other suggestions. |
Frankly if it's just 2.12 I would keep the single $ and tell users who are stuck on 2.12 to ignore the warning in the build. |
I agree with Jakub |
Great work on this ! The only thing that bothers me is the |
This PR introduces open enumerations that are codegenerated with an extra
Unknown
case for handling values that are not defined in the specification. The presence of thealloy#openEnum
trait on anenum
orintEnum
shape will trigger this to take place in the codegen.The main need for this is that AWS treats enums as open in several places in their SDKs/APIs where as we treat them as closed always (in the past). This PR will allow for maintaining the default of closed enumerations, while also enabling interop with AWS and the like.